<?php

namespace app\home\controller;

use think\Controller;
use think\Db;

class Base extends Controller
{
    protected $user;
    protected $uid;

    public function _initialize()
    {
        $token = trim(input('token', ''));
        $user = Db::name('user')->where(['token' => $token])->find();
        if (!$user) {
            echo json_encode(['code' => 100, 'message' => '请登录']);
            exit;
        }

        $this->user = $user;
       
    }


}